Many colleges want to optimize the money they receive from their alumni. In order to do so, they need to identify and predict the salary/unemployment rate of recent graduates based on their education and other various factors. Doing so, they will be able to put more money into those programs to get a larger return on their investments (students).
Business Question:
Where can colleges put money in order to optimize the amount of money they receive from recent graduates?
Analysis Question:
Based on recent graduates and their characteristics/education, what would be their predicted median salary? Would they make over or less than six figures?
This data is pulled from the 2012-12 American Community Survey Public Use Microdata Series, and is limited to those users under the age of 28. The general purpose of this code and data is based upon the story [linked phrase] (https://fivethirtyeight.com/features/the-economic-guide-to-picking-a-college-major/)
What will we be doing? Methods, techniques, why?
A brief look at the raw data can be found below.
## 'data.frame': 172 obs. of 21 variables:
## $ Rank : int 1 2 3 4 5 6 7 8 9 10 ...
## $ Major_code : int 2419 2416 2415 2417 2405 2418 6202 5001 2414 2408 ...
## $ Major : chr "PETROLEUM ENGINEERING" "MINING AND MINERAL ENGINEERING" "METALLURGICAL ENGINEERING" "NAVAL ARCHITECTURE AND MARINE ENGINEERING" ...
## $ Total : int 2339 756 856 1258 32260 2573 3777 1792 91227 81527 ...
## $ Men : int 2057 679 725 1123 21239 2200 2110 832 80320 65511 ...
## $ Women : int 282 77 131 135 11021 373 1667 960 10907 16016 ...
## $ Major_category : chr "Engineering" "Engineering" "Engineering" "Engineering" ...
## $ ShareWomen : num 0.121 0.102 0.153 0.107 0.342 ...
## $ Sample_size : int 36 7 3 16 289 17 51 10 1029 631 ...
## $ Employed : int 1976 640 648 758 25694 1857 2912 1526 76442 61928 ...
## $ Full_time : int 1849 556 558 1069 23170 2038 2924 1085 71298 55450 ...
## $ Part_time : int 270 170 133 150 5180 264 296 553 13101 12695 ...
## $ Full_time_year_round: int 1207 388 340 692 16697 1449 2482 827 54639 41413 ...
## $ Unemployed : int 37 85 16 40 1672 400 308 33 4650 3895 ...
## $ Unemployment_rate : num 0.0184 0.1172 0.0241 0.0501 0.0611 ...
## $ Median : int 110000 75000 73000 70000 65000 65000 62000 62000 60000 60000 ...
## $ P25th : int 95000 55000 50000 43000 50000 50000 53000 31500 48000 45000 ...
## $ P75th : int 125000 90000 105000 80000 75000 102000 72000 109000 70000 72000 ...
## $ College_jobs : int 1534 350 456 529 18314 1142 1768 972 52844 45829 ...
## $ Non_college_jobs : int 364 257 176 102 4440 657 314 500 16384 10874 ...
## $ Low_wage_jobs : int 193 50 0 0 972 244 259 220 3253 3170 ...
## - attr(*, "na.action")= 'omit' Named int 22
## ..- attr(*, "names")= chr "22"
As can be seen above, many of the categories are integer values. Many of these variables can be converted into factor variables in addition to the numerical ones. In addition, the variables Rank, Major Code, and Major can be dropped as the Rank variable highly correlates with the salary variable, and the other two are to specific and cannot be generalized.
majors_added_categorical <- majors_raw %>% mutate(Over.50K = ifelse(Median > 50000, "Over", "Under.Equal"), High.Unemployment = ifelse(Unemployment_rate > 0.5, "High", "Low")) %>% select(-1, -2, -3)
In addition, the categorical variable categories can be compressed in order for more useful data for the analysis.
##
## Sciences Arts Other STEM
## 54 30 48 40
In order to do some analysis, all categorical variables need to be one hot encoded, which is done below:
# One Hot Encoded Data
majors_onehot <- one_hot(data.table(majors_factors), cols = c("Major_category", "High.Unemployment"))
# Normal Data
majors <- majors_factors
Before beginning with the analytical part of the exploration, it is beneficial to visualize and summarize the data in order to get a better understanding of the data in its entirety, and with an emphasis on variables you believe to be important for your analysis.
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 22000 33000 36000 40077 45000 110000
## Total Men Women ShareWomen Sample_size Employed
## Total 1.0000000 0.8780884 0.9447645 0.1429993 0.9455747 0.9962140
## Men 0.8780884 1.0000000 0.6727589 -0.1120136 0.8751756 0.8706047
## Women 0.9447645 0.6727589 1.0000000 0.2978321 0.8626064 0.9440365
## ShareWomen 0.1429993 -0.1120136 0.2978321 1.0000000 0.0974957 0.1475468
## Sample_size 0.9455747 0.8751756 0.8626064 0.0974957 1.0000000 0.9644062
## Full_time Part_time Full_time_year_round Unemployed
## Total 0.9893392 0.9502684 0.9811118 0.9747684
## Men 0.8935631 0.7515917 0.8924540 0.8694115
## Women 0.9176812 0.9545133 0.9057195 0.9116943
## ShareWomen 0.1202001 0.2122898 0.1125230 0.1212430
## Sample_size 0.9783624 0.8245444 0.9852125 0.9179335
## Unemployment_rate Median P25th P75th College_jobs
## Total 0.08319170 -0.1067377 -0.07192608 -0.08319767 0.8004648
## Men 0.10150234 0.0259906 0.03872518 0.05239290 0.5631684
## Women 0.05910776 -0.1828419 -0.13773826 -0.16452834 0.8519460
## ShareWomen 0.07320458 -0.6186898 -0.50019863 -0.58693216 0.1955501
## Sample_size 0.06295494 -0.0644750 -0.02442859 -0.05225614 0.7012309
## Non_college_jobs Low_wage_jobs
## Total 0.9412471 0.9355096
## Men 0.8514998 0.7913360
## Women 0.8721318 0.9044699
## ShareWomen 0.1370066 0.1878496
## Sample_size 0.9153352 0.8601159
## [1] 172 22
## [1] 121 22
## [1] 26 22
## [1] 25 22
## Classes 'data.table' and 'data.frame': 121 obs. of 21 variables:
## $ Total : int 756 1258 32260 2573 1792 81527 41542 15058 14955 4279 ...
## $ Men : int 679 1123 21239 2200 832 65511 33258 12953 8407 2949 ...
## $ Women : int 77 135 11021 373 960 16016 8284 2105 6548 1330 ...
## $ Major_category_Sciences: int 0 0 0 0 1 0 0 0 0 0 ...
## $ Major_category_Arts : int 0 0 0 0 0 0 0 0 0 0 ...
## $ Major_category_Other : int 0 0 0 0 0 0 0 0 0 0 ...
## $ Major_category_STEM : int 1 1 1 1 0 1 1 1 1 1 ...
## $ ShareWomen : num 0.102 0.107 0.342 0.145 0.536 ...
## $ Sample_size : int 7 16 289 17 10 631 399 147 79 22 ...
## $ Employed : int 640 758 25694 1857 1526 61928 32506 11391 10047 3307 ...
## $ Full_time : int 556 1069 23170 2038 1085 55450 30315 11106 9017 2751 ...
## $ Part_time : int 170 150 5180 264 553 12695 5146 2724 2694 878 ...
## $ Full_time_year_round : int 388 692 16697 1449 827 41413 23621 8790 5986 1967 ...
## $ Unemployed : int 85 40 1672 400 33 3895 2275 794 1019 78 ...
## $ Unemployment_rate : num 0.1172 0.0501 0.0611 0.1772 0.0212 ...
## $ P25th : int 55000 43000 50000 50000 31500 45000 45000 42000 36000 39000 ...
## $ P75th : int 90000 80000 75000 102000 109000 72000 75000 70000 70000 65000 ...
## $ College_jobs : int 350 529 18314 1142 972 45829 23694 8184 6439 2626 ...
## $ Non_college_jobs : int 257 102 4440 657 500 10874 5721 2425 2471 391 ...
## $ Low_wage_jobs : int 50 0 972 244 220 3170 980 372 789 81 ...
## $ High.Unemployment_Low : int 1 1 1 1 1 1 1 1 1 1 ...
## - attr(*, ".internal.selfref")=<externalptr>
## C5.0
##
## 121 samples
## 21 predictor
## 2 classes: 'Over', 'Under.Equal'
##
## No pre-processing
## Resampling: Cross-Validated (10 fold, repeated 5 times)
## Summary of sample sizes: 109, 109, 108, 110, 109, 110, ...
## Resampling results across tuning parameters:
##
## model winnow trials Accuracy Kappa
## rules FALSE 1 0.8828904 0.5146200
## rules FALSE 10 0.8895804 0.5464086
## rules FALSE 20 0.8895804 0.5401519
## rules TRUE 1 0.8666900 0.4184862
## rules TRUE 10 0.8552797 0.3739537
## rules TRUE 20 0.8600233 0.3922811
## tree FALSE 1 0.8812238 0.5178700
## tree FALSE 10 0.8847086 0.5278754
## tree FALSE 20 0.8862471 0.5334452
## tree TRUE 1 0.8650233 0.4069148
## tree TRUE 10 0.8552797 0.3865361
## tree TRUE 20 0.8584848 0.4007829
##
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were trials = 10, model = rules and
## winnow = FALSE.
## Confusion Matrix and Statistics
##
## Actual
## Prediction Over Under.Equal
## Over 2 1
## Under.Equal 2 21
##
## Accuracy : 0.8846
## 95% CI : (0.6985, 0.9755)
## No Information Rate : 0.8462
## P-Value [Acc > NIR] : 0.417
##
## Kappa : 0.5063
##
## Mcnemar's Test P-Value : 1.000
##
## Sensitivity : 0.50000
## Specificity : 0.95455
## Pos Pred Value : 0.66667
## Neg Pred Value : 0.91304
## Prevalence : 0.15385
## Detection Rate : 0.07692
## Detection Prevalence : 0.11538
## Balanced Accuracy : 0.72727
##
## 'Positive' Class : Over
##
# Given a certain values for the other variables predict the Median Salary
## C5.0 variable importance
##
## only 20 most important variables shown (out of 21)
##
## Overall
## Unemployment_rate 100.00
## P25th 100.00
## P75th 100.00
## College_jobs 95.87
## Major_category_STEM 81.82
## Unemployed 75.21
## ShareWomen 74.38
## Low_wage_jobs 64.46
## Non_college_jobs 55.37
## Part_time 48.76
## Men 48.76
## Sample_size 32.23
## High.Unemployment_Low 0.00
## Major_category_Sciences 0.00
## Major_category_Arts 0.00
## Women 0.00
## Full_time_year_round 0.00
## Major_category_Other 0.00
## Full_time 0.00
## Total 0.00
## C5.0
##
## 121 samples
## 21 predictor
## 2 classes: 'Over', 'Under.Equal'
##
## No pre-processing
## Resampling: Cross-Validated (10 fold, repeated 5 times)
## Summary of sample sizes: 109, 109, 108, 110, 109, 110, ...
## Resampling results across tuning parameters:
##
## model winnow trials Accuracy Kappa
## rules FALSE 20 0.8895804 0.5401519
## rules FALSE 30 0.8878904 0.5217057
## rules FALSE 40 0.8863520 0.5173161
## rules TRUE 20 0.8615618 0.3936318
## rules TRUE 30 0.8632284 0.4026427
## rules TRUE 40 0.8616900 0.3982531
## tree FALSE 20 0.8862471 0.5334452
## tree FALSE 30 0.8844289 0.5345751
## tree FALSE 40 0.8810723 0.5235075
## tree TRUE 20 0.8584848 0.4007829
## tree TRUE 30 0.8615618 0.4125823
## tree TRUE 40 0.8600233 0.4081927
##
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were trials = 20, model = rules and
## winnow = FALSE.
## C5.0
##
## 121 samples
## 21 predictor
## 2 classes: 'Over', 'Under.Equal'
##
## No pre-processing
## Resampling: Cross-Validated (10 fold, repeated 5 times)
## Summary of sample sizes: 109, 109, 108, 110, 109, 110, ...
## Resampling results across tuning parameters:
##
## model winnow trials Accuracy Kappa
## rules FALSE 1 0.8828904 0.5146200
## rules FALSE 10 0.8895804 0.5464086
## rules FALSE 20 0.8895804 0.5401519
## rules TRUE 1 0.8666900 0.4184862
## rules TRUE 10 0.8552797 0.3739537
## rules TRUE 20 0.8600233 0.3922811
## tree FALSE 1 0.8812238 0.5178700
## tree FALSE 10 0.8847086 0.5278754
## tree FALSE 20 0.8862471 0.5334452
## tree TRUE 1 0.8650233 0.4069148
## tree TRUE 10 0.8552797 0.3865361
## tree TRUE 20 0.8584848 0.4007829
##
## Accuracy was used to select the optimal model using the largest value.
## The final values used for the model were trials = 10, model = rules and
## winnow = FALSE.
## Confusion Matrix and Statistics
##
## Actual
## Prediction Over Under.Equal
## Over 2 1
## Under.Equal 2 21
##
## Accuracy : 0.8846
## 95% CI : (0.6985, 0.9755)
## No Information Rate : 0.8462
## P-Value [Acc > NIR] : 0.417
##
## Kappa : 0.5063
##
## Mcnemar's Test P-Value : 1.000
##
## Sensitivity : 0.50000
## Specificity : 0.95455
## Pos Pred Value : 0.66667
## Neg Pred Value : 0.91304
## Prevalence : 0.15385
## Detection Rate : 0.07692
## Detection Prevalence : 0.11538
## Balanced Accuracy : 0.72727
##
## 'Positive' Class : Over
##
## Confusion Matrix and Statistics
##
## Actual
## Prediction Over Under.Equal
## Over 3 0
## Under.Equal 0 22
##
## Accuracy : 1
## 95% CI : (0.8628, 1)
## No Information Rate : 0.88
## P-Value [Acc > NIR] : 0.04093
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.00
## Specificity : 1.00
## Pos Pred Value : 1.00
## Neg Pred Value : 1.00
## Prevalence : 0.12
## Detection Rate : 0.12
## Detection Prevalence : 0.12
## Balanced Accuracy : 1.00
##
## 'Positive' Class : Over
##
## [1] 0.3953488
##
## LE.EQ.20K G.50K
## 104 68
## [1] 121 21
## [1] 25 21
## [1] 26 21
## [1] 4.472136
# Determining the number of trees that should be used
# The "err.rate" argument includes a list of the cumulative error rates
# for each tree, by class and in aggregate for data points not
# included in the tree (OOB).
# View(as.data.frame(combined_RF$err.rate))
err.rate <- as.data.frame(combined_RF$err.rate)
# View(err.rate)
# The "oob.times" argument includes the number of times that each data point
# is not excluded from trees in the random forest.
# View(as.data.frame(combined_RF$oob.times))
combined_RF_error = data.frame(1:nrow(combined_RF$err.rate),
combined_RF$err.rate)
combined_RF_error
## X1.nrow.combined_RF.err.rate. OOB LE.EQ.20K G.50K
## 1 1 0.2982456 0.36666667 0.2222222
## 2 2 0.2325581 0.25490196 0.2000000
## 3 3 0.2475248 0.23728814 0.2619048
## 4 4 0.2110092 0.19047619 0.2391304
## 5 5 0.2280702 0.16176471 0.3260870
## 6 6 0.2288136 0.18309859 0.2978723
## 7 7 0.2000000 0.15068493 0.2765957
## 8 8 0.2250000 0.19178082 0.2765957
## 9 9 0.1735537 0.10958904 0.2708333
## 10 10 0.1900826 0.12328767 0.2916667
## 11 11 0.1818182 0.09589041 0.3125000
## 12 12 0.1983471 0.10958904 0.3333333
## 13 13 0.2066116 0.12328767 0.3333333
## 14 14 0.2231405 0.10958904 0.3958333
## 15 15 0.2066116 0.10958904 0.3541667
## 16 16 0.2148760 0.10958904 0.3750000
## 17 17 0.2148760 0.12328767 0.3541667
## 18 18 0.1983471 0.12328767 0.3125000
## 19 19 0.2066116 0.13698630 0.3125000
## 20 20 0.1900826 0.13698630 0.2708333
## 21 21 0.2148760 0.15068493 0.3125000
## 22 22 0.1983471 0.13698630 0.2916667
## 23 23 0.2066116 0.13698630 0.3125000
## 24 24 0.1983471 0.13698630 0.2916667
## 25 25 0.1818182 0.12328767 0.2708333
## 26 26 0.1735537 0.10958904 0.2708333
## 27 27 0.1818182 0.12328767 0.2708333
## 28 28 0.1818182 0.12328767 0.2708333
## 29 29 0.1652893 0.10958904 0.2500000
## 30 30 0.1570248 0.10958904 0.2291667
## 31 31 0.1652893 0.12328767 0.2291667
## 32 32 0.1735537 0.12328767 0.2500000
## 33 33 0.1652893 0.10958904 0.2500000
## 34 34 0.1735537 0.13698630 0.2291667
## 35 35 0.1818182 0.13698630 0.2500000
## 36 36 0.1735537 0.10958904 0.2708333
## 37 37 0.1818182 0.12328767 0.2708333
## 38 38 0.1818182 0.12328767 0.2708333
## 39 39 0.1735537 0.12328767 0.2500000
## 40 40 0.1818182 0.13698630 0.2500000
## 41 41 0.1818182 0.13698630 0.2500000
## 42 42 0.1818182 0.13698630 0.2500000
## 43 43 0.1818182 0.13698630 0.2500000
## 44 44 0.1652893 0.12328767 0.2291667
## 45 45 0.1818182 0.12328767 0.2708333
## 46 46 0.1818182 0.13698630 0.2500000
## 47 47 0.1818182 0.13698630 0.2500000
## 48 48 0.1652893 0.12328767 0.2291667
## 49 49 0.1735537 0.13698630 0.2291667
## 50 50 0.1818182 0.13698630 0.2500000
## 51 51 0.1818182 0.13698630 0.2500000
## 52 52 0.1900826 0.13698630 0.2708333
## 53 53 0.1983471 0.13698630 0.2916667
## 54 54 0.1983471 0.13698630 0.2916667
## 55 55 0.1818182 0.13698630 0.2500000
## 56 56 0.1818182 0.13698630 0.2500000
## 57 57 0.1900826 0.13698630 0.2708333
## 58 58 0.1818182 0.13698630 0.2500000
## 59 59 0.1818182 0.13698630 0.2500000
## 60 60 0.1818182 0.13698630 0.2500000
## 61 61 0.1735537 0.13698630 0.2291667
## 62 62 0.1900826 0.13698630 0.2708333
## 63 63 0.1900826 0.13698630 0.2708333
## 64 64 0.1818182 0.13698630 0.2500000
## 65 65 0.1900826 0.15068493 0.2500000
## 66 66 0.1818182 0.13698630 0.2500000
## 67 67 0.1735537 0.12328767 0.2500000
## 68 68 0.1735537 0.12328767 0.2500000
## 69 69 0.1735537 0.12328767 0.2500000
## 70 70 0.1983471 0.13698630 0.2916667
## 71 71 0.1983471 0.12328767 0.3125000
## 72 72 0.1900826 0.12328767 0.2916667
## 73 73 0.1818182 0.10958904 0.2916667
## 74 74 0.1818182 0.10958904 0.2916667
## 75 75 0.1735537 0.09589041 0.2916667
## 76 76 0.1735537 0.09589041 0.2916667
## 77 77 0.1735537 0.09589041 0.2916667
## 78 78 0.1818182 0.10958904 0.2916667
## 79 79 0.1818182 0.10958904 0.2916667
## 80 80 0.1900826 0.10958904 0.3125000
## 81 81 0.1818182 0.10958904 0.2916667
## 82 82 0.1735537 0.09589041 0.2916667
## 83 83 0.1735537 0.09589041 0.2916667
## 84 84 0.1735537 0.09589041 0.2916667
## 85 85 0.1818182 0.10958904 0.2916667
## 86 86 0.1818182 0.10958904 0.2916667
## 87 87 0.1818182 0.10958904 0.2916667
## 88 88 0.1735537 0.10958904 0.2708333
## 89 89 0.1735537 0.10958904 0.2708333
## 90 90 0.1818182 0.12328767 0.2708333
## 91 91 0.1735537 0.10958904 0.2708333
## 92 92 0.1735537 0.10958904 0.2708333
## 93 93 0.1735537 0.10958904 0.2708333
## 94 94 0.1735537 0.10958904 0.2708333
## 95 95 0.1735537 0.10958904 0.2708333
## 96 96 0.1735537 0.10958904 0.2708333
## 97 97 0.1735537 0.10958904 0.2708333
## 98 98 0.1735537 0.10958904 0.2708333
## 99 99 0.1735537 0.10958904 0.2708333
## 100 100 0.1735537 0.10958904 0.2708333
## 101 101 0.1735537 0.10958904 0.2708333
## 102 102 0.1735537 0.10958904 0.2708333
## 103 103 0.1735537 0.10958904 0.2708333
## 104 104 0.1735537 0.10958904 0.2708333
## 105 105 0.1735537 0.10958904 0.2708333
## 106 106 0.1735537 0.10958904 0.2708333
## 107 107 0.1818182 0.10958904 0.2916667
## 108 108 0.1735537 0.10958904 0.2708333
## 109 109 0.1900826 0.12328767 0.2916667
## 110 110 0.1900826 0.12328767 0.2916667
## 111 111 0.1900826 0.12328767 0.2916667
## 112 112 0.1900826 0.12328767 0.2916667
## 113 113 0.1983471 0.12328767 0.3125000
## 114 114 0.1983471 0.12328767 0.3125000
## 115 115 0.1818182 0.10958904 0.2916667
## 116 116 0.1900826 0.12328767 0.2916667
## 117 117 0.1900826 0.12328767 0.2916667
## 118 118 0.1983471 0.12328767 0.3125000
## 119 119 0.1900826 0.12328767 0.2916667
## 120 120 0.1983471 0.12328767 0.3125000
## 121 121 0.1900826 0.12328767 0.2916667
## 122 122 0.1900826 0.12328767 0.2916667
## 123 123 0.1983471 0.13698630 0.2916667
## 124 124 0.1900826 0.12328767 0.2916667
## 125 125 0.1900826 0.12328767 0.2916667
## 126 126 0.1900826 0.12328767 0.2916667
## 127 127 0.1900826 0.12328767 0.2916667
## 128 128 0.1900826 0.12328767 0.2916667
## 129 129 0.1900826 0.12328767 0.2916667
## 130 130 0.1983471 0.13698630 0.2916667
## 131 131 0.1983471 0.13698630 0.2916667
## 132 132 0.1983471 0.13698630 0.2916667
## 133 133 0.1983471 0.13698630 0.2916667
## 134 134 0.1983471 0.13698630 0.2916667
## 135 135 0.1983471 0.13698630 0.2916667
## 136 136 0.1983471 0.13698630 0.2916667
## 137 137 0.1983471 0.13698630 0.2916667
## 138 138 0.1983471 0.13698630 0.2916667
## 139 139 0.1983471 0.13698630 0.2916667
## 140 140 0.1983471 0.13698630 0.2916667
## 141 141 0.1983471 0.13698630 0.2916667
## 142 142 0.1983471 0.13698630 0.2916667
## 143 143 0.1900826 0.12328767 0.2916667
## 144 144 0.1900826 0.12328767 0.2916667
## 145 145 0.1900826 0.12328767 0.2916667
## 146 146 0.1900826 0.12328767 0.2916667
## 147 147 0.1900826 0.12328767 0.2916667
## 148 148 0.1900826 0.12328767 0.2916667
## 149 149 0.1900826 0.12328767 0.2916667
## 150 150 0.1900826 0.12328767 0.2916667
## 151 151 0.1900826 0.12328767 0.2916667
## 152 152 0.1900826 0.12328767 0.2916667
## 153 153 0.1818182 0.10958904 0.2916667
## 154 154 0.1900826 0.12328767 0.2916667
## 155 155 0.1818182 0.10958904 0.2916667
## 156 156 0.1818182 0.10958904 0.2916667
## 157 157 0.1818182 0.10958904 0.2916667
## 158 158 0.1900826 0.12328767 0.2916667
## 159 159 0.1818182 0.10958904 0.2916667
## 160 160 0.1818182 0.10958904 0.2916667
## 161 161 0.1818182 0.10958904 0.2916667
## 162 162 0.1818182 0.10958904 0.2916667
## 163 163 0.1818182 0.10958904 0.2916667
## 164 164 0.1818182 0.10958904 0.2916667
## 165 165 0.1900826 0.10958904 0.3125000
## 166 166 0.1818182 0.10958904 0.2916667
## 167 167 0.1900826 0.10958904 0.3125000
## 168 168 0.1818182 0.10958904 0.2916667
## 169 169 0.1818182 0.10958904 0.2916667
## 170 170 0.1818182 0.10958904 0.2916667
## 171 171 0.1818182 0.10958904 0.2916667
## 172 172 0.1818182 0.10958904 0.2916667
## 173 173 0.1900826 0.10958904 0.3125000
## 174 174 0.1900826 0.10958904 0.3125000
## 175 175 0.1818182 0.10958904 0.2916667
## 176 176 0.1735537 0.09589041 0.2916667
## 177 177 0.1735537 0.09589041 0.2916667
## 178 178 0.1818182 0.09589041 0.3125000
## 179 179 0.1818182 0.09589041 0.3125000
## 180 180 0.1818182 0.09589041 0.3125000
## 181 181 0.1818182 0.09589041 0.3125000
## 182 182 0.1735537 0.09589041 0.2916667
## 183 183 0.1818182 0.09589041 0.3125000
## 184 184 0.1818182 0.09589041 0.3125000
## 185 185 0.1818182 0.09589041 0.3125000
## 186 186 0.1818182 0.09589041 0.3125000
## 187 187 0.1900826 0.10958904 0.3125000
## 188 188 0.1900826 0.10958904 0.3125000
## 189 189 0.1900826 0.10958904 0.3125000
## 190 190 0.1818182 0.09589041 0.3125000
## 191 191 0.1818182 0.09589041 0.3125000
## 192 192 0.1818182 0.09589041 0.3125000
## 193 193 0.1900826 0.10958904 0.3125000
## 194 194 0.1900826 0.10958904 0.3125000
## 195 195 0.1900826 0.10958904 0.3125000
## 196 196 0.1900826 0.10958904 0.3125000
## 197 197 0.1900826 0.10958904 0.3125000
## 198 198 0.1900826 0.10958904 0.3125000
## 199 199 0.1900826 0.10958904 0.3125000
## 200 200 0.1900826 0.10958904 0.3125000
## 201 201 0.1900826 0.10958904 0.3125000
## 202 202 0.1900826 0.10958904 0.3125000
## 203 203 0.1900826 0.10958904 0.3125000
## 204 204 0.1900826 0.10958904 0.3125000
## 205 205 0.1900826 0.10958904 0.3125000
## 206 206 0.1900826 0.10958904 0.3125000
## 207 207 0.1900826 0.10958904 0.3125000
## 208 208 0.1900826 0.10958904 0.3125000
## 209 209 0.1983471 0.10958904 0.3333333
## 210 210 0.1900826 0.10958904 0.3125000
## 211 211 0.1900826 0.10958904 0.3125000
## 212 212 0.1983471 0.10958904 0.3333333
## 213 213 0.1983471 0.10958904 0.3333333
## 214 214 0.1983471 0.10958904 0.3333333
## 215 215 0.1900826 0.10958904 0.3125000
## 216 216 0.1983471 0.10958904 0.3333333
## 217 217 0.1983471 0.10958904 0.3333333
## 218 218 0.1983471 0.10958904 0.3333333
## 219 219 0.1983471 0.10958904 0.3333333
## 220 220 0.1983471 0.10958904 0.3333333
## 221 221 0.1983471 0.10958904 0.3333333
## 222 222 0.1900826 0.09589041 0.3333333
## 223 223 0.1900826 0.09589041 0.3333333
## 224 224 0.1900826 0.09589041 0.3333333
## 225 225 0.1900826 0.09589041 0.3333333
## 226 226 0.1900826 0.09589041 0.3333333
## 227 227 0.1900826 0.09589041 0.3333333
## 228 228 0.1983471 0.10958904 0.3333333
## 229 229 0.1983471 0.10958904 0.3333333
## 230 230 0.1900826 0.09589041 0.3333333
## 231 231 0.1900826 0.09589041 0.3333333
## 232 232 0.1900826 0.09589041 0.3333333
## 233 233 0.1900826 0.09589041 0.3333333
## 234 234 0.1983471 0.10958904 0.3333333
## 235 235 0.1983471 0.10958904 0.3333333
## 236 236 0.1983471 0.10958904 0.3333333
## 237 237 0.1983471 0.10958904 0.3333333
## 238 238 0.1983471 0.10958904 0.3333333
## 239 239 0.1983471 0.10958904 0.3333333
## 240 240 0.1983471 0.10958904 0.3333333
## 241 241 0.1983471 0.10958904 0.3333333
## 242 242 0.1983471 0.10958904 0.3333333
## 243 243 0.1983471 0.10958904 0.3333333
## 244 244 0.1983471 0.10958904 0.3333333
## 245 245 0.1983471 0.10958904 0.3333333
## 246 246 0.1983471 0.10958904 0.3333333
## 247 247 0.1983471 0.10958904 0.3333333
## 248 248 0.1983471 0.10958904 0.3333333
## 249 249 0.1983471 0.10958904 0.3333333
## 250 250 0.1983471 0.10958904 0.3333333
## 251 251 0.1983471 0.10958904 0.3333333
## 252 252 0.1983471 0.10958904 0.3333333
## 253 253 0.1983471 0.10958904 0.3333333
## 254 254 0.1983471 0.10958904 0.3333333
## 255 255 0.1983471 0.10958904 0.3333333
## 256 256 0.1983471 0.10958904 0.3333333
## 257 257 0.1900826 0.10958904 0.3125000
## 258 258 0.1900826 0.10958904 0.3125000
## 259 259 0.1983471 0.10958904 0.3333333
## 260 260 0.1983471 0.10958904 0.3333333
## 261 261 0.1900826 0.10958904 0.3125000
## 262 262 0.1900826 0.10958904 0.3125000
## 263 263 0.1900826 0.10958904 0.3125000
## 264 264 0.1900826 0.10958904 0.3125000
## 265 265 0.1818182 0.10958904 0.2916667
## 266 266 0.1900826 0.10958904 0.3125000
## 267 267 0.1900826 0.10958904 0.3125000
## 268 268 0.1983471 0.10958904 0.3333333
## 269 269 0.1983471 0.10958904 0.3333333
## 270 270 0.1983471 0.10958904 0.3333333
## 271 271 0.1983471 0.10958904 0.3333333
## 272 272 0.1900826 0.10958904 0.3125000
## 273 273 0.1900826 0.10958904 0.3125000
## 274 274 0.1983471 0.10958904 0.3333333
## 275 275 0.1900826 0.10958904 0.3125000
## 276 276 0.1900826 0.10958904 0.3125000
## 277 277 0.1983471 0.10958904 0.3333333
## 278 278 0.1900826 0.10958904 0.3125000
## 279 279 0.1983471 0.10958904 0.3333333
## 280 280 0.1983471 0.10958904 0.3333333
## 281 281 0.1983471 0.10958904 0.3333333
## 282 282 0.1983471 0.10958904 0.3333333
## 283 283 0.2066116 0.12328767 0.3333333
## 284 284 0.2066116 0.12328767 0.3333333
## 285 285 0.2148760 0.12328767 0.3541667
## 286 286 0.2148760 0.12328767 0.3541667
## 287 287 0.2066116 0.10958904 0.3541667
## 288 288 0.2066116 0.10958904 0.3541667
## 289 289 0.2148760 0.12328767 0.3541667
## 290 290 0.2148760 0.12328767 0.3541667
## 291 291 0.2066116 0.10958904 0.3541667
## 292 292 0.2148760 0.12328767 0.3541667
## 293 293 0.2148760 0.12328767 0.3541667
## 294 294 0.2148760 0.12328767 0.3541667
## 295 295 0.2148760 0.12328767 0.3541667
## 296 296 0.2148760 0.12328767 0.3541667
## 297 297 0.2148760 0.12328767 0.3541667
## 298 298 0.2148760 0.12328767 0.3541667
## 299 299 0.2148760 0.12328767 0.3541667
## 300 300 0.2066116 0.10958904 0.3541667
## 301 301 0.2148760 0.12328767 0.3541667
## 302 302 0.2148760 0.12328767 0.3541667
## 303 303 0.2148760 0.12328767 0.3541667
## 304 304 0.2066116 0.10958904 0.3541667
## 305 305 0.2148760 0.12328767 0.3541667
## 306 306 0.2066116 0.10958904 0.3541667
## 307 307 0.2066116 0.10958904 0.3541667
## 308 308 0.2066116 0.10958904 0.3541667
## 309 309 0.2066116 0.10958904 0.3541667
## 310 310 0.2066116 0.10958904 0.3541667
## 311 311 0.2066116 0.10958904 0.3541667
## 312 312 0.2148760 0.12328767 0.3541667
## 313 313 0.2066116 0.10958904 0.3541667
## 314 314 0.2066116 0.10958904 0.3541667
## 315 315 0.2148760 0.12328767 0.3541667
## 316 316 0.2148760 0.12328767 0.3541667
## 317 317 0.2066116 0.10958904 0.3541667
## 318 318 0.2066116 0.10958904 0.3541667
## 319 319 0.2066116 0.10958904 0.3541667
## 320 320 0.2066116 0.10958904 0.3541667
## 321 321 0.2066116 0.10958904 0.3541667
## 322 322 0.2066116 0.10958904 0.3541667
## 323 323 0.2066116 0.10958904 0.3541667
## 324 324 0.2066116 0.10958904 0.3541667
## 325 325 0.2148760 0.12328767 0.3541667
## 326 326 0.2148760 0.12328767 0.3541667
## 327 327 0.2148760 0.12328767 0.3541667
## 328 328 0.2148760 0.12328767 0.3541667
## 329 329 0.2066116 0.10958904 0.3541667
## 330 330 0.2148760 0.12328767 0.3541667
## 331 331 0.2148760 0.12328767 0.3541667
## 332 332 0.2148760 0.12328767 0.3541667
## 333 333 0.2148760 0.12328767 0.3541667
## 334 334 0.2066116 0.10958904 0.3541667
## 335 335 0.2066116 0.10958904 0.3541667
## 336 336 0.2066116 0.10958904 0.3541667
## 337 337 0.2066116 0.10958904 0.3541667
## 338 338 0.2066116 0.10958904 0.3541667
## 339 339 0.2066116 0.10958904 0.3541667
## 340 340 0.2066116 0.10958904 0.3541667
## 341 341 0.2066116 0.10958904 0.3541667
## 342 342 0.2066116 0.10958904 0.3541667
## 343 343 0.2066116 0.10958904 0.3541667
## 344 344 0.2066116 0.10958904 0.3541667
## 345 345 0.2066116 0.10958904 0.3541667
## 346 346 0.2066116 0.10958904 0.3541667
## 347 347 0.2066116 0.10958904 0.3541667
## 348 348 0.2066116 0.10958904 0.3541667
## 349 349 0.2066116 0.10958904 0.3541667
## 350 350 0.2066116 0.10958904 0.3541667
## 351 351 0.2066116 0.10958904 0.3541667
## 352 352 0.2066116 0.10958904 0.3541667
## 353 353 0.2066116 0.10958904 0.3541667
## 354 354 0.2066116 0.10958904 0.3541667
## 355 355 0.2066116 0.10958904 0.3541667
## 356 356 0.2066116 0.10958904 0.3541667
## 357 357 0.2066116 0.10958904 0.3541667
## 358 358 0.2066116 0.10958904 0.3541667
## 359 359 0.2066116 0.10958904 0.3541667
## 360 360 0.2066116 0.10958904 0.3541667
## 361 361 0.2066116 0.10958904 0.3541667
## 362 362 0.2066116 0.10958904 0.3541667
## 363 363 0.2066116 0.10958904 0.3541667
## 364 364 0.2066116 0.10958904 0.3541667
## 365 365 0.2066116 0.10958904 0.3541667
## 366 366 0.2066116 0.10958904 0.3541667
## 367 367 0.2066116 0.10958904 0.3541667
## 368 368 0.2066116 0.10958904 0.3541667
## 369 369 0.2066116 0.10958904 0.3541667
## 370 370 0.2066116 0.10958904 0.3541667
## 371 371 0.2066116 0.10958904 0.3541667
## 372 372 0.2066116 0.10958904 0.3541667
## 373 373 0.2066116 0.10958904 0.3541667
## 374 374 0.2066116 0.10958904 0.3541667
## 375 375 0.2066116 0.10958904 0.3541667
## 376 376 0.2148760 0.12328767 0.3541667
## 377 377 0.2148760 0.12328767 0.3541667
## 378 378 0.2148760 0.12328767 0.3541667
## 379 379 0.2148760 0.12328767 0.3541667
## 380 380 0.2148760 0.12328767 0.3541667
## 381 381 0.2148760 0.12328767 0.3541667
## 382 382 0.2148760 0.12328767 0.3541667
## 383 383 0.2148760 0.12328767 0.3541667
## 384 384 0.2148760 0.12328767 0.3541667
## 385 385 0.2148760 0.12328767 0.3541667
## 386 386 0.2148760 0.12328767 0.3541667
## 387 387 0.2066116 0.10958904 0.3541667
## 388 388 0.2066116 0.10958904 0.3541667
## 389 389 0.2066116 0.10958904 0.3541667
## 390 390 0.2066116 0.10958904 0.3541667
## 391 391 0.2148760 0.12328767 0.3541667
## 392 392 0.2148760 0.12328767 0.3541667
## 393 393 0.2148760 0.12328767 0.3541667
## 394 394 0.2148760 0.12328767 0.3541667
## 395 395 0.2148760 0.12328767 0.3541667
## 396 396 0.2066116 0.10958904 0.3541667
## 397 397 0.2066116 0.10958904 0.3541667
## 398 398 0.1983471 0.10958904 0.3333333
## 399 399 0.2066116 0.12328767 0.3333333
## 400 400 0.2148760 0.12328767 0.3541667
## 401 401 0.2066116 0.10958904 0.3541667
## 402 402 0.2066116 0.12328767 0.3333333
## 403 403 0.1983471 0.10958904 0.3333333
## 404 404 0.1983471 0.10958904 0.3333333
## 405 405 0.1983471 0.10958904 0.3333333
## 406 406 0.1983471 0.10958904 0.3333333
## 407 407 0.2066116 0.12328767 0.3333333
## 408 408 0.1983471 0.10958904 0.3333333
## 409 409 0.1983471 0.12328767 0.3125000
## 410 410 0.1983471 0.10958904 0.3333333
## 411 411 0.1900826 0.10958904 0.3125000
## 412 412 0.1900826 0.10958904 0.3125000
## 413 413 0.1983471 0.10958904 0.3333333
## 414 414 0.1983471 0.10958904 0.3333333
## 415 415 0.1983471 0.10958904 0.3333333
## 416 416 0.1983471 0.10958904 0.3333333
## 417 417 0.1983471 0.12328767 0.3125000
## 418 418 0.1983471 0.10958904 0.3333333
## 419 419 0.2066116 0.12328767 0.3333333
## 420 420 0.2066116 0.12328767 0.3333333
## 421 421 0.2066116 0.12328767 0.3333333
## 422 422 0.2066116 0.12328767 0.3333333
## 423 423 0.2066116 0.12328767 0.3333333
## 424 424 0.2066116 0.12328767 0.3333333
## 425 425 0.2066116 0.12328767 0.3333333
## 426 426 0.2066116 0.12328767 0.3333333
## 427 427 0.2066116 0.12328767 0.3333333
## 428 428 0.2066116 0.12328767 0.3333333
## 429 429 0.2066116 0.12328767 0.3333333
## 430 430 0.2066116 0.12328767 0.3333333
## 431 431 0.2066116 0.12328767 0.3333333
## 432 432 0.1983471 0.12328767 0.3125000
## 433 433 0.1983471 0.12328767 0.3125000
## 434 434 0.1983471 0.12328767 0.3125000
## 435 435 0.1983471 0.12328767 0.3125000
## 436 436 0.1983471 0.12328767 0.3125000
## 437 437 0.1983471 0.12328767 0.3125000
## 438 438 0.1983471 0.12328767 0.3125000
## 439 439 0.1983471 0.12328767 0.3125000
## 440 440 0.1983471 0.12328767 0.3125000
## 441 441 0.1983471 0.12328767 0.3125000
## 442 442 0.1983471 0.12328767 0.3125000
## 443 443 0.1983471 0.12328767 0.3125000
## 444 444 0.1983471 0.12328767 0.3125000
## 445 445 0.1983471 0.12328767 0.3125000
## 446 446 0.1983471 0.12328767 0.3125000
## 447 447 0.2066116 0.13698630 0.3125000
## 448 448 0.2148760 0.13698630 0.3333333
## 449 449 0.2148760 0.13698630 0.3333333
## 450 450 0.2148760 0.13698630 0.3333333
## 451 451 0.2066116 0.12328767 0.3333333
## 452 452 0.2066116 0.12328767 0.3333333
## 453 453 0.2066116 0.12328767 0.3333333
## 454 454 0.2066116 0.12328767 0.3333333
## 455 455 0.2066116 0.12328767 0.3333333
## 456 456 0.2066116 0.12328767 0.3333333
## 457 457 0.2066116 0.12328767 0.3333333
## 458 458 0.1983471 0.12328767 0.3125000
## 459 459 0.2066116 0.12328767 0.3333333
## 460 460 0.2066116 0.12328767 0.3333333
## 461 461 0.2066116 0.12328767 0.3333333
## 462 462 0.2066116 0.12328767 0.3333333
## 463 463 0.2066116 0.12328767 0.3333333
## 464 464 0.2066116 0.12328767 0.3333333
## 465 465 0.2066116 0.12328767 0.3333333
## 466 466 0.2066116 0.12328767 0.3333333
## 467 467 0.2066116 0.12328767 0.3333333
## 468 468 0.2066116 0.12328767 0.3333333
## 469 469 0.2066116 0.12328767 0.3333333
## 470 470 0.1983471 0.12328767 0.3125000
## 471 471 0.2066116 0.12328767 0.3333333
## 472 472 0.1900826 0.10958904 0.3125000
## 473 473 0.2066116 0.12328767 0.3333333
## 474 474 0.1900826 0.10958904 0.3125000
## 475 475 0.1983471 0.12328767 0.3125000
## 476 476 0.1983471 0.12328767 0.3125000
## 477 477 0.1983471 0.12328767 0.3125000
## 478 478 0.1983471 0.12328767 0.3125000
## 479 479 0.1983471 0.12328767 0.3125000
## 480 480 0.1983471 0.12328767 0.3125000
## 481 481 0.1983471 0.12328767 0.3125000
## 482 482 0.1983471 0.12328767 0.3125000
## 483 483 0.1983471 0.12328767 0.3125000
## 484 484 0.1983471 0.12328767 0.3125000
## 485 485 0.1983471 0.12328767 0.3125000
## 486 486 0.1983471 0.12328767 0.3125000
## 487 487 0.1983471 0.12328767 0.3125000
## 488 488 0.1983471 0.12328767 0.3125000
## 489 489 0.1983471 0.12328767 0.3125000
## 490 490 0.1983471 0.12328767 0.3125000
## 491 491 0.1983471 0.12328767 0.3125000
## 492 492 0.1983471 0.12328767 0.3125000
## 493 493 0.1983471 0.12328767 0.3125000
## 494 494 0.1983471 0.12328767 0.3125000
## 495 495 0.1983471 0.12328767 0.3125000
## 496 496 0.1983471 0.12328767 0.3125000
## 497 497 0.1983471 0.12328767 0.3125000
## 498 498 0.1983471 0.12328767 0.3125000
## 499 499 0.1983471 0.12328767 0.3125000
## 500 500 0.1983471 0.12328767 0.3125000
colnames(combined_RF_error) = c("Number of Trees", "Out of the Box","<=20K", ">20K")
combined_RF_error$Diff <- combined_RF_error$'>20K'-combined_RF_error$`<=20K`
# View(combined_RF_error)
# 54 Trees should be used because that amount is correlated to the minimum OOB error and >20K value.
## 'data.frame': 121 obs. of 21 variables:
## $ Total : int 2339 756 1258 32260 3777 1792 91227 81527 15058 14955 ...
## $ Men : int 2057 679 1123 21239 2110 832 80320 65511 12953 8407 ...
## $ Women : int 282 77 135 11021 1667 960 10907 16016 2105 6548 ...
## $ Major_category : Factor w/ 4 levels "Sciences","Arts",..: 4 4 4 4 3 1 4 4 4 4 ...
## $ ShareWomen : num 0.121 0.102 0.107 0.342 0.441 ...
## $ Sample_size : int 36 7 16 289 51 10 1029 631 147 79 ...
## $ Employed : int 1976 640 758 25694 2912 1526 76442 61928 11391 10047 ...
## $ Full_time : int 1849 556 1069 23170 2924 1085 71298 55450 11106 9017 ...
## $ Part_time : int 270 170 150 5180 296 553 13101 12695 2724 2694 ...
## $ Full_time_year_round: int 1207 388 692 16697 2482 827 54639 41413 8790 5986 ...
## $ Unemployed : int 37 85 40 1672 308 33 4650 3895 794 1019 ...
## $ Unemployment_rate : num 0.0184 0.1172 0.0501 0.0611 0.0957 ...
## $ Median : int 110000 75000 70000 65000 62000 62000 60000 60000 60000 60000 ...
## $ P25th : int 95000 55000 43000 50000 53000 31500 48000 45000 42000 36000 ...
## $ P75th : int 125000 90000 80000 75000 72000 109000 70000 72000 70000 70000 ...
## $ College_jobs : int 1534 350 529 18314 1768 972 52844 45829 8184 6439 ...
## $ Non_college_jobs : int 364 257 102 4440 314 500 16384 10874 2425 2471 ...
## $ Low_wage_jobs : int 193 50 0 972 259 220 3253 3170 372 789 ...
## $ Over.50K : Factor w/ 2 levels "Over","Under.Equal": 1 1 1 1 1 1 1 1 1 1 ...
## $ High.Unemployment : Factor w/ 1 level "Low": 1 1 1 1 1 1 1 1 1 1 ...
## $ combined_target : Factor w/ 2 levels "LE.EQ.20K","G.50K": 1 1 1 2 2 2 1 1 1 2 ...
## mtry = 4 OOB error = 20.66%
## Searching left ...
## mtry = 2 OOB error = 19.01%
## 0.08 0.05
## mtry = 1 OOB error = 29.75%
## -0.5652174 0.05
## Searching right ...
## mtry = 8 OOB error = 14.88%
## 0.2173913 0.05
## mtry = 16 OOB error = 9.09%
## 0.3888889 0.05
## mtry = 20 OOB error = 11.57%
## -0.2727273 0.05
##
## Call:
## randomForest(x = x, y = y, mtry = res[which.min(res[, 2]), 1])
## Type of random forest: classification
## Number of trees: 500
## No. of variables tried at each split: 16
##
## OOB estimate of error rate: 12.4%
## Confusion matrix:
## LE.EQ.20K G.50K class.error
## LE.EQ.20K 65 8 0.1095890
## G.50K 7 41 0.1458333
Because the built in Random Forest Model was not agreeable with the tuning done with the caret library, an original random forest classification tuning metric was created in order to determine the best values for the three hyperparameters determined above.
Now, we can set the hyperparameter values to try and tune the model.
## .mtry .sampsize .ntree
## 1 3 50 200
## 2 4 50 200
## 3 5 50 200
## 4 3 100 200
## 5 4 100 200
## 6 5 100 200
## 7 3 200 200
## 8 4 200 200
## 9 5 200 200
## 10 3 50 300
## 11 4 50 300
## 12 5 50 300
## 13 3 100 300
## 14 4 100 300
## 15 5 100 300
## 16 3 200 300
## 17 4 200 300
## 18 5 200 300
## 19 3 50 400
## 20 4 50 400
## 21 5 50 400
## 22 3 100 400
## 23 4 100 400
## 24 5 100 400
## 25 3 200 400
## 26 4 200 400
## 27 5 200 400
## 121 samples
## 19 predictor
## 2 classes: 'Over', 'Under.Equal'
##
## No pre-processing
## Resampling: Cross-Validated (5 fold, repeated 5 times)
## Summary of sample sizes: 97, 97, 97, 96, 97, 97, ...
## Resampling results across tuning parameters:
##
## mtry sampsize ntree ROC Sens Spec
## 3 50 200 0.9903810 0.8533333 1.0000000
## 3 50 300 0.9910159 0.8300000 1.0000000
## 3 50 400 0.9910159 0.8266667 1.0000000
## 3 100 200 0.9913333 0.8500000 1.0000000
## 3 100 300 0.9871429 0.8266667 1.0000000
## 3 100 400 0.9910159 0.8300000 1.0000000
## 3 200 200 0.9910159 0.8300000 1.0000000
## 3 200 300 0.9897460 0.8400000 1.0000000
## 3 200 400 0.9903492 0.8400000 0.9980952
## 4 50 200 0.9913333 0.8633333 1.0000000
## 4 50 300 0.9916508 0.8666667 1.0000000
## 4 50 400 0.9910159 0.8533333 1.0000000
## 4 100 200 0.9909841 0.9000000 1.0000000
## 4 100 300 0.9897143 0.8666667 1.0000000
## 4 100 400 0.9916508 0.8766667 1.0000000
## 4 200 200 0.9906984 0.8766667 1.0000000
## 4 200 300 0.9925873 0.8666667 1.0000000
## 4 200 400 0.9929206 0.8533333 1.0000000
## 5 50 200 0.9916508 0.9233333 1.0000000
## 5 50 300 0.9910159 0.8966667 1.0000000
## 5 50 400 0.9922857 0.8966667 1.0000000
## 5 100 200 0.9903810 0.8966667 1.0000000
## 5 100 300 0.9916508 0.8866667 1.0000000
## 5 100 400 0.9916508 0.9100000 1.0000000
## 5 200 200 0.9922857 0.8866667 1.0000000
## 5 200 300 0.9910159 0.8866667 1.0000000
## 5 200 400 0.9916508 0.8633333 1.0000000
##
## ROC was used to select the optimal model using the largest value.
## The final values used for the model were mtry = 4, ntree = 400 and sampsize
## = 200.
# Evaluation of Model
What can you say about the results of the methods section as it relates to your question given the limitations to your model?
What additional analysis is needed or what limited your analysis on this project?